package com.example.loop.mapper;

import com.example.loop.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Liaorun
 */
@Mapper
public interface RoleMapper {

    @Select("select role.id, role from role, user, user_role ur where role.id = ur.role_id and ur.user_id = user.id and user.id = #{id}")
    List<Role> findRoleByUserId(@Param("id") long id);
}
